package com.supinfo.suptracking.service;

import com.supinfo.suptracking.dao.ZoneDao;
import com.supinfo.suptracking.entity.Car;
import com.supinfo.suptracking.entity.Zone;
import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Fabien, Jérémy, Ludovic, Brice
 */

@Stateless
public class ZoneService {
    
    @EJB
    private ZoneDao zoneDao;
    
    public void processAddZone(Zone zone) {
        zoneDao.addZone(zone);
    }
    
    public List<Zone> processGetZoneByPosition(String latitude, String longitude) {
        return zoneDao.getZoneByPosition(latitude, longitude);
    }
    
    public List<Zone> processGetAllZoneByCar(Car car) {
        return zoneDao.getAllZoneByCar(car);
    }
    
    public List<Zone> processGetAllZone() {
        return zoneDao.getAllZone();
    }    
    public List<Zone> processGetAllZonebyRadiusMeter(Long radiusMeter) {
        return zoneDao.getAllZonebyRadiusMeter(radiusMeter);
    }
    
    public List<Zone> processGetAllZoneByTimeStamp(Date lowTimestamp, Date highTimeStamp) {
        return zoneDao.getAllZoneByTimeStamp(lowTimestamp, highTimeStamp);
    }
    
    public Zone processGetZoneById(Long id){
        return zoneDao.getZoneById(id);
    }
    
    public void processUpdateZone(Zone zone){
        zoneDao.updateZone(zone);
    }
    
    public void processDelZone(Zone zone){
        zoneDao.delZone(zone);
    }
}
